package com.sample.transitiondemo;

import android.app.ActivityOptions;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.FloatRange;
import android.support.annotation.RequiresApi;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.transition.Explode;
import android.transition.Slide;
import android.view.Gravity;
import android.view.View;
import android.view.Window;

import com.facebook.drawee.view.SimpleDraweeView;

public class MainActivity extends AppCompatActivity {

    private FloatingActionButton action1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
//        Explode slide = new Explode();
        Slide slide = new Slide();
        getWindow().setExitTransition(slide);
        getWindow().setReenterTransition(slide);
        setContentView(R.layout.activity_main);

        action1 = (FloatingActionButton) findViewById(R.id.action1);
        action1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, TransitionActivity.class);
                startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(MainActivity.this).toBundle());
            }
        });

        FrescoDiamondImageView f = (FrescoDiamondImageView) findViewById(R.id.fresco);
        f.setImageURL("http://img.lanrentuku.com/img/allimg/1606/14660381353675.jpg");


        SimpleDraweeView sv = (SimpleDraweeView) findViewById(R.id.test);
        sv.setImageURI(Uri.parse("http://img.lanrentuku.com/img/allimg/1606/14660381353675.jpg"));
    }


}
